﻿using AiShou.IBLL;
using AiShou.BLL;
using AiShou.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AiShou.Common;

namespace AiShou.WebSite
{
    public partial class Register : System.Web.UI.Page
    {
        IAccountManager AccountManager = new AccountManager();
        protected void Page_Load(object sender, EventArgs e)
        {
           
        }

        protected void btnRegister_Click(object sender, EventArgs e)
        {
           
            //当前页面所有验证都通过
            if (Page.IsValid)
            {
                TBLogins logins = new TBLogins()
                {
                    Password = txtPassword.Text,
                    MobileNumber = txtMobileNumber.Text,
                    UserName = txtUserName.Text

                };
                OperResult result = AccountManager.Register(logins);
                if (result.StatusCode== StatusCode.Succeed)
                {
                    Response.Redirect("Login.aspx");
                }
            }
        }
    }
}